$(document).ready(init);

function init() {

$.plot(
	 $("#flot-example-1"),
	 [
	   {
		 label: "Series 1",
		 data: [ [0, 0], [1, 1], [2, 1], [3, 2] ],
		 lines: {show: true},
		 points: {show: true}
	   },
	   {
		 label: "Series 2",
		 data: [ [0, 3], [1, 5], [2, 8], [3, 13] ],
		 lines: {show: true},
		 points: {show: true}   
	   },
	   {
		 label: "Series 3",
		 data: [ [0, 5], [1, 10], [2, 8], [3, 6] ],
		 lines: {show: true},
		 points: {show: true}   
	   }
	 ]
	);
	
	$.plot(
	   $("#flot-example-2"),
	   [
		{
		  label: "Total Things Per Year",
		  data: [ [2011, 450], [2012, 550], [2013, 320], [2014, 700] ],
		  bars: {
			show: true,
			barWidth: 0.5,
			align: "center"
		  }   
		}
	 ],
	 {
	   xaxis: {
		 ticks: [
		   [2011, "2011"],
		   [2012, "2012"],
		   [2013, "2013"],
		   [2014, "2014"]
		 ]
	   }   
	 }
	);
	
	$.plot(
	 $("#flot-example-3"),
	 [
	   {
		 label: "Slice 1",
		 data: 44
		 },
		{
		 label: "Slice 2",
		 data: 75
		 },
		 {
		 label: "Slice 3",
		 data: 8
		 }
	 ],
	 
	 {
		 series: {
		   pie: {
			 show: true,
			 radius: 1,
			 tilt: 0.5,
			 innerRadius: 0.5,
			 label: {
                    show: true,
                    radius: 3/4,
                    formatter: function(label, series){
                        return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">'+label+'<br/>'+Math.round(series.percent)+'%</div>';
                    },
					threshold: 0.1,
                    background: { opacity: 0.5 , color: '#000'}
                }
		 }
		},
		
		legend: {
		  show: false
		}
	}
	
	);
}